package service.group;

import dao.GroupDAO;
import dao.RecordDuplicateException;
import entities.Group;


public class GroupServiceInMemory implements GroupService {

	public GroupServiceInMemory(){
		
	}
	
	public static GroupService newInstance(){
		return new GroupServiceInMemory();
	}
	
	/**
	 * Finds a customer based on the customer id.
	 * @param userid - user id
	 * @return the instance of the customer
	 */
	public Group findGroup(Long a_id){
		GroupDAO db = GroupDAO.getInstance();
		Group result = null;
		result = db.findGroup(a_id);
		return result;
	}
	
	
	/**
	 * Adds a new customer to the system.
	 * @param obj - the customer instance to add
	 */
	
	public void addGroup(Group obj) throws RecordDuplicateException{
		GroupDAO db = GroupDAO.getInstance();	
		db.addGroup(obj);
		return;
	}

}
